﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Basmus.ReadWrite;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Basmus.Tests.ReadWrite
{
    [TestClass]
    public class Int32ReaderWriterTest
    {
        [TestMethod]
        public void WriteTest()
        {
            var target = new Int32ReaderWriter();

            var actual = target.Write(100);

            Assert.AreEqual("100", actual);
        }

        [TestMethod()]
        public void ReadSuccessTest()
        {
            var target = new Int32ReaderWriter();

            var expected = ReadResult<Int32>.Success(100);

            var actual = target.Read("100");

            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ReadErrorTest()
        {
            var target = new Int32ReaderWriter();

            var expected = ReadResult<Int32>.Error();

            var actual = target.Read("100asd");

            Assert.AreEqual(expected, actual);
        }
    }
}
